<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{margin: 0;padding: 0;}
    ul{margin: 100px auto; position: relative; width: 650px; height: 750px;}
    li{list-style: none; width: 50px; height: 50px; background:orange; position: absolute}
    </style>
</head>
<body>
  <ul id="uls"></ul>


    <script>
    var elem=document.getElementById("uls");
    for(i=0;i<7;i++){
        elem.innerHTML+='<li style="top:'+ i*50+'px;left:'+ i*50+'px;"><li>'
        elem.innerHTML+='<li style="top:'+ i*50+'px;right:'+ i*50+'px;"></li>'
    }
    
    </script>
</body>
</html>